Skip to content

feat(id-native-shell): Bevy widget renderer for widget/1 surfaces (#12657 step 2c) - #13266

Merged
dezren39 merged 1 commit into
mainfrom
lane-vc-12657
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-vc-12657

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Step 2c of #12657 — the Bevy widget renderer in pkgs/id/crates/id-native-shell, following the two-layer shape steps 2a (PR #13214, scene) and 2b (PR #13244, audio) established. This is the last named slice of #12657: with it, all three rich surfaces accepted in step 1 (scene, audio, widget) have native-shell renderers.

What lands

  • widget::WidgetModel — the pure presentation model: a validated WidgetSurface becomes control models in document order, each stacked on its own row, carrying kind, label, action and toggle state from the contract, plus the derivations this renderer owns — an accent color (fixed hue family per kind, lightness stepped by the control id's FNV-1a hash, mirroring scene::node_color) and the focus order (controls that deliver an action are focusable, display-only controls are not; focus starts on the first focusable control; focus_step is the pure wrap-around navigation rule).
  • widget::WidgetRenderPlugin — reads the existing PresentedView (world input stays on the same contract frames): per view-sequence change it despawns the old view's control entities and spawns one entity per control with its prescribed ControlPlacement; a chained system keeps the Focused marker on exactly the control the focus state names. Non-widget views clear the entities and focus state. Registered in the binary beside SceneRenderPlugin and AudioRenderPlugin.
  • widget::example_widgets — the deterministic example world's widget document: the harbor controls of the scene/audio examples (Start button, Lights toggle, Enter-the-harbor link), the same document the step-1c contract tests project.

Scope boundary (stated in the module docs too): the plugin owns presentation state only. Capturing keyboard/pointer input, moving focus with it, and delivering a focused control's named action to the world are later wiring steps over these same entities and the model's pure navigation functions — the same boundary 2b drew at device playback.

Verification (laptop route; remote dispatch cannot run nix develop — the #13159-family container gap):

  • cargo nextest run -p id-native-shell 101 passed / 0 failed (91 baseline + 10 new widget tests: determinism, stack order + state carriage, display-only focus skipping, wrap-around navigation incl. the no-focusable case, accent kind families, from_view gating, entity spawn + placement fields, initial Focused marker, clear-on-non-widget, text-projection parity).
  • cargo fmt --check clean; clippy cap-lints run has no findings in the new module (the un-capped workspace run still stops earlier on the pre-existing id-store expect() sites tracked by id-store: admission.rs expect() on Mutex locks breaks the clippy gates on main (PR #13156) #13207, untouched).

CI runs on main only per repo policy, so no PR checks apply.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T12:40:46Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Start Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…2657 step 2c)

Pure WidgetModel over the host-validated WidgetSurface from step 1c:
controls stacked one per row in document order, kind/label/action and
toggle state carried through, accent color derived per kind family
stepped by the control id's FNV-1a hash, and the focus order derived
(actionable controls focusable, display-only skipped, wrap-around
focus_step). WidgetRenderPlugin rebuilds one entity per control on
view-sequence change with its prescribed ControlPlacement and keeps
the Focused marker on the model's focus position. example_widgets is
the harbor-controls document the step-1c contract tests project.

Scope boundary, matching steps 2a/2b: the plugin owns presentation
state only — input capture and delivering a focused control's named
action to the world are later wiring steps over these same entities
and the model's pure navigation functions.

Verification (laptop route; the fleet-build container cannot run
nix develop, the #13159-family gap): cargo nextest run
-p id-native-shell 101 passed / 0 failed (91 baseline + 10 new);
cargo fmt --check clean; clippy cap-lints run has no findings in the
new module (the un-capped workspace run still stops on the
pre-existing #13207 id-store sites, untouched).
@dezren39
dezren39 merged commit 795b240 into main Nov 23, 2026
1 check passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T12:41:54.917623Z 1fde2dd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 deleted the lane-vc-12657 branch November 23, 2026 12:41
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant